import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const address = new Vuex.Store({
	state: {
		id: -1,
		city: '上海',
		AddressAuto: '',
		AutoBuilding: '',
		HouseNumber: '',
		IsDefault: '',
		Lat: '',
		Lng: '',
		ShippingCost: '',
		address: '',
		area: '',
		name: '',
		phone: '',
		province: '',
		gender: '先生',
		currentCity:''
	},
	mutations: {
		setTemp(state, provider) {
			state.id = provider.id || -1
			state.city = provider.city || '上海'
			state.AddressAuto = provider.AddressAuto || ''
			state.AutoBuilding = provider.AutoBuilding|| ''
			state.HouseNumber = provider.HouseNumber|| ''
			state.IsDefault = provider.IsDefault|| 0
			state.Lat = provider.Lat|| ''
			state.Lng = provider.Lng|| ''
			state.ShippingCost = provider.ShippingCost || 0
			state.address = provider.address|| ''
			state.area = provider.area|| ''
			state.name = provider.name|| ''
			state.phone = provider.phone|| ''
			state.province = provider.province|| ''
			state.gender = provider.gender|| '先生'
		},
		setCurrentCity(state,city){
			state.currentCity = city;
		}
	},
	
})
export default address
